package com.gs.SynAntiWandering.model;


import com.gs.SynAntiWandering.callback.Callback;
import com.gs.SynAntiWandering.model.listener.OnResultListener;
import com.gs.SynAntiWandering.util.OKHttpUtil;

import java.lang.reflect.Type;

public class UtilModel {
    public void upload(String path, final OnResultListener listener, Type typeofT) {
        OKHttpUtil.getInstance().uploadFileAsync(OKHttpUtil.NET_URL + "/api/utils/uploadfile", path, new Callback() {
            @Override
            public void onSuccess(Object obj) {
                listener.onSuccess(obj);
            }

            @Override
            public void onFailed(Exception e) {
                listener.onFails(e);
            }
        }, typeofT);
    }
}
